package com.wyy.util;

import com.wyy.bean.Student;

import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName PageUtil
 * @Description //TODO
 * @Author wky
 * @Date 2021/9/21 13:46
 * @Version 1.0
 **/
public class PageUtil {
    
    //1.页码值  2.显示条数  3.查询结果列表  4.总条数  5.总页数
    private Integer pageIndex;
    private Integer pageSize = 10;
    private List list;
    private Integer total;
    private Integer totalPage;
    
    public Integer getPageIndex() {
        return pageIndex;
    }
    
    public void setPageIndex(Integer pageIndex) {
        this.pageIndex = pageIndex;
    }
    
    public Integer getPageSize() {
        return pageSize;
    }
    
    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }
    
    public List getList() {
        return list;
    }
    
    public void setList(List list) {
        this.list = list;
    }
    
    public Integer getTotal() {
        return total;
    }
    
    public void setTotal(Integer total) {
        this.total = total;
    }
    
    public Integer getTotalPage() {
        return total%pageSize==0?total/pageSize:total/pageSize+1;
    }
    
    public void setTotalPage(Integer totalPage) {
        this.totalPage = totalPage;
    }
    
    @Override
    public String toString() {
        return "PageUtil{" +
                "pageIndex=" + pageIndex +
                ", pageSize=" + pageSize +
                ", list=" + list +
                ", total=" + total +
                ", totalPage=" + totalPage +
                '}';
    }
}
